package com.mes.cloud.common;

/**
 * @ProjectName: shinho
 * @Package: com.mes.cloud.common
 * @ClassName: TableName
 * @Author: ZYP
 * @Description:
 * @Date: 2019/5/20 9:46
 */
public enum TableName {
    AREACONTROLLER("AreaController","行政区"),
    DICTCONTROLLER("DictController","数据字典"),
    MENUCONTROLLER("MenuController","菜单"),
    ORGCONTROLLER("OrgController","组织"),
    PARAMETERCONTROLLER("ParameterController","系统参数"),
    POSTCONTROLLER("PostController","职位"),
    ROLECONTROLLER("RoleController","角色"),
    ROLEMENUREFCONTROLLER("RoleMenuRefController","角色菜单"),
    USERCONTROLLER("UserController","用户"),
    USERPOSTREFCONTROLLER("UserPostRefController","用户职位"),
    USERROLEREFCONTROLLER("UserRoleRefController","用户角色"),
    AREASERVICEIMPL("AreaServiceImpl","行政区"),
    DICTSERVICEIMPL("DictServiceImpl","数据字典"),
    MENUSERVICEIMPL("MenuServiceImpl","菜单"),
    ORGSERVICEIMPL("OrgServiceImpl","组织"),
    PARAMETERSERVICEIMPL("ParameterServiceImpl","系统参数"),
    POSTSERVICEIMPL("PostServiceImpl","职位"),
    ROLESERVICEIMPL("RoleServiceImpl","角色"),
    ROLEMENUREFSERVICEIMPL("RoleMenuRefServiceImpl","角色菜单"),
    USERSERVICEIMPL("UserServiceImpl","用户"),
    USERPOSTREFSERVICEIMPL("UserPostRefServiceImpl","用户职位"),
    USERROLEREFSERVICEIMPL("UserRoleRefServiceImpl","用户角色");

    private  final String name;
    private  final String value;

    TableName(String name, String value) {
        this.name = name;
        this.value = value;
    }

    public String getName() {
        return name;
    }

    public String getValue() {
        return value;
    }

    public static String getValue(String name) {
        for (TableName emu : TableName.values()) {
            if (emu.name.equals(name)) {
                return emu.value;
            }
        }
        return name;
    }

    public static TableName getEnum(String code) {
        for (TableName emu : TableName.values()) {
            if (emu.name.equals(code)) {
                return emu;
            }
        }
        return null;
    }

}
